NDepend.API Documentation
ToHashSetEx<T>(IEnumerable<T>,IEqualityComparer<T>) Method
NDepend.Helpers Namespace > ExtensionMethodsSet Class > ToHashSetEx Method : ToHashSetEx<T>(IEnumerable<T>,IEqualityComparer<T>) Method
The type of the elements of seq.
An IEnumerable<T> to create an hashset from.
The equality comparer on elements.
Creates an hashset from a IEnumerable<T>.
Syntax

Parameters

seq
An IEnumerable<T> to create an hashset from.
equalityComparer
The equality comparer on elements.

Type Parameters

T
The type of the elements of seq.

Return Value

An hashset that contains the elements from the input sequence.
Remarks
This method exists since NDepend v2018.1.1 because the .NET Fx v4.7.2 introduces a ToHashSet() extension method with the same signature as the one in the NDepend.API. As a consequence ambiguous call errors are emitted by the compiler when using ToHashSet() in a .NET fx v4.7.2 (or upper) environment. ToHashSet() can still be used as a static method ExtensionMethodsSet.ToHashSet(...). To avoid any problem, a straightforward solution is to replace "ToHashSet()" with "ToHashSetEx()" in all your .ndproj and .ndrules textual files that contain your code queries and rules.
Requirements

Target Platforms: Windows 11, 10, 8, 7 and Linux, MacOS with net8.0, net7.0 or net6.0 installed

See Also

Reference

ExtensionMethodsSet Class
ExtensionMethodsSet Members
Overload List